import request from '@/utils/request'
import {POS_SERVER_URL} from '@/utils/common'
import {getSignedParams} from '@/utils/sign'

// 获取商品列表
export function getStockList (stationId) {
  return request({
    url: POS_SERVER_URL + '/api/pos-client/store/stock-list',
    method: 'post',
    data: getSignedParams({stationId: stationId})
  })
}

// 获取当前班次非油消费明细列表
export function getSaleDetailList (stationId) {
  return request({
    url: POS_SERVER_URL + '/api/pos-client/store/sale-commodity-detail-list',
    method: 'post',
    data: getSignedParams({stationId: stationId})
  })
}

// 获取该油站的促销活动列表
export function getPromotionList (stationId) {
  return request({
    url: POS_SERVER_URL + '/api/pos-client/store/promotion-list',
    method: 'post',
    data: getSignedParams({stationId: stationId})
  })
}

// 根据领取码获取商品的详细信息
export function getSaleCommodityInfo (uid) {
  return request({
    url: POS_SERVER_URL + '/api/pc/store/saleCommodityInfo',
    method: 'post',
    data: getSignedParams({uid: uid})
  })
}

// 根据领取码进行商品线下领取
export function receiveCommodity (uid, operator) {
  return request({
    url: POS_SERVER_URL + '/api/pc/store/receiveCommodity',
    method: 'post',
    data: getSignedParams({uid: uid, salesman: operator})
  })
}
